import GameCtr from "./GameCtr";
import GameView from "./GameView/GameView";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GameScene extends cc.Component {
    // onLoad () {}
    
    @property(cc.Prefab) gameViewPrefab: cc.Prefab

    private m_GameCtr: GameCtr = null
    private m_GameView: GameView = null

    start() {
        this.m_GameCtr = new GameCtr()
        this.m_GameView = cc.instantiate(this.gameViewPrefab).getComponent(GameView)
        this.node.addChild(this.m_GameView.node)
        this.m_GameCtr.Init(this.m_GameView)
        this.m_GameCtr.Play()
    }
    
    onDestroy(){
        this.m_GameCtr.Exit()
    }
    // update (dt) {}
}
